package com.yjh.pojo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReservationMain {
    @TableId(type = IdType.AUTO)
    private Integer reserveId;

    @TableField("user_id") // 外键，关联用户表
    private Integer userId;

    @TableField("court_id") // 外键，关联球场信息表
    private Integer courtId;

    @TableField("reserve_date")
    private LocalDate reserveDate; // 预约日期（仅日期，无时间）

    @TableField("reserve_status")
    private Integer reserveStatus; // 0=待使用，1=已完成，2=已取消，3=逾期未到

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
